exports.deleteBannerColumn = function(req,res){

    var bodyParams = req.routeInfo.bodyParams;

    //查询该栏目下是否有广告
    function isUsedBanner(cb){

        R.SEND_HTTP(
            req,
            res,
            {
                url    : CORE_APIConfig.coreAPI.cmsBannerSearch.Request_Api_Url + "/cb_cbcid/" + bodyParams.cbc_id,
                method : 'POST',
                data   : {
                    fields : 'cb_id'
                }
            },
            function (data) { 
            
                if(data.result.data.length > 0){
                    return RES.errorResponse(res,'抱歉，该栏目中包含广告，请先删除广告');
                }

                cb();
                
            }
        );

    }
    

    //删除广告栏目
    function deleteBannerColumn(cb){

        R.SEND_HTTP(
            req,
            res,
            {
                url    : CORE_APIConfig.coreAPI.cmsBannerColumnDelete.Request_Api_Url,
                method : 'POST',
                data   : {
                    delete_where  : 'cbc_id',
                    cbc_id        : bodyParams.cbc_id,
                    cbc_is_delete : 1
                }
            },
            function (data) { 

                cb();
                
            }
        );

    }
    

    F.Serial([
        isUsedBanner,
        deleteBannerColumn
    ],() => {
        RES.successResponse(res);
    })

}